home *** CD-ROM | disk | FTP | other *** search
/ MacWorld 1999 September (IDG) / Sep99.iso / MarkzScout™ 14-day trial / Scripts / Pages Where Images Occur.m1s < prev    next >
Encoding:
Text File  |  1999-02-05  |  1.9 KB  |  91 lines  |  [TEXT/MSCT]

  1. //
  2. // Pages Where Images Occur.M1S: show image list and show pages
  3. // where each image occurs.
  4. //
  5.  
  6. //
  7. // *************************************
  8. // Procedures
  9. // *************************************
  10. // 
  11.  
  12. proc imageUsedProc
  13.   if it <> theJob then
  14.     imagePageCount = imagePageCount[it.code] + 1 
  15.     imagePageCount[it.code] = imagePageCount
  16.     imagePageList[it.code,imagePagecount] = pageList[pageNr]
  17.   end if
  18. endproc
  19.  
  20. proc imageProc
  21.   if it <> theJob then
  22.     imageCount = imageCount + 1
  23.     imageList[imageCount] = it
  24.     imagePageCount[it.code] = 0
  25.   end if
  26. endproc
  27.  
  28. proc pageProc
  29.   pageCount = pageCount + 1
  30.   pageList[pageCount] = it
  31. endproc
  32.  
  33. // 
  34. // Execute a procedure for all images
  35. //
  36. theJob = it
  37.  
  38. print "Used Image List for " + theJob.NAME
  39.  
  40. pageCount = 0
  41. on page do pageProc
  42. scan theJob links uses,contains,overlaps
  43. scan reset
  44.  
  45. imageCount = 0
  46. on document do imageProc
  47. scan theJob links uses,contains,overlaps,defines
  48. scan reset
  49.  
  50. on document do imageUsedProc
  51. pageNr = 0
  52. while pageNr < pageCount do
  53.   pageNr = pageNr + 1
  54.   pageImageCount[pageNr] = 0
  55.   scan pageList[pageNr] links uses,contains,overlaps
  56. wend
  57. scan reset
  58.  
  59. imageNr = 0
  60. while imageNr < imageCount do
  61.   imageNr = imageNr + 1
  62.   image = imageList[imageNr]
  63.   print "Image '" + image.name + "' (" + image.class_name;
  64.   imagePageCount = imagePageCount[image.code]  
  65.   pageNr = 0
  66.   while pageNr < imagePageCount do
  67.     if pageNr = 0 then
  68.       if imagePageCount = 1 then
  69.         print ") occurs on page"
  70.       else
  71.         print ") occurs on pages"
  72.       end if
  73.     end if
  74.     pageNr = pageNr + 1
  75.     page = imagePageList[image.code,pageNr]
  76.     if page.printed_pagenumber <> page.pagenumber then
  77.       print "  " + page.pagenumber + " (" + page.printed_pagenumber + ")"
  78.     else
  79.       print "  " + page.pagenumber
  80.     end if
  81.   wend
  82.   if pageNr = 0 then
  83.     print ")  is not used"
  84.   end if
  85. wend
  86. if imageCount = 0 then
  87.   print "No images in document"
  88. end if
  89.  
  90. print "---------------------------------------"
  91.